package nl.blindwars.model;

import java.util.ArrayList;

public class Player {
	private ArrayList<City> cities;

	private String name;
	
	private boolean isHuman;
	
	public Player(String name, boolean isHuman) {
		this.name = name;
		this.isHuman = isHuman;
		
		cities = new ArrayList<City>();
	}

	public void addCity(City city) {
		Player previousOwner = city.getOwner();

		if(previousOwner != null) {
			previousOwner.removeCity(city);
		}
		
		cities.add(city);

		city.setOwner(this);
	}

	public void removeCity(City city) {
		cities.remove(city);
	}
	
	public int getNumberOfCities() {
		return cities.size();
	}

	public ArrayList<City> getCities() {
		return cities;
	}

//	public void setCities(ArrayList<City> cities) {
//		this.cities= cities;
//	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isHuman() {
		return isHuman;
	}

	public void setHuman(boolean isHuman) {
		this.isHuman = isHuman;
	}
	
}
